package br.net.woodstock.tickettoride.spring.web.access;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.context.WebApplicationContext;

import br.net.woodstock.tickettoride.orm.User;
import br.net.woodstock.tickettoride.web.jsf.access.common.AbstractMenuBean;
import br.net.woodstock.tickettoride.web.jsf.security.common.JSFSecurityUtils;

@Controller("menuBean")
@Scope(WebApplicationContext.SCOPE_SESSION)
public class MenuBean extends AbstractMenuBean {

	private static final long	serialVersionUID	= -2388650344847820940L;

	public MenuBean() {
		super();
	}

	@Override
	public boolean isEnabled() {
		User user = JSFSecurityUtils.getSessionUser();
		if (user != null) {
			return true;
		}
		return false;
	}

}
